package com.xlobo.api.fund.testcase;

import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.xlobo.api.fund.parameter.SetAccountActionBean;
import com.xlobo.api.fund.service.SetAccountActionCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P3;
import com.ymttest.business.service.XloboAccountCallService;

/**
 * 获取账户信息 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_SetAccountAction {
	private static SetAccountActionBean accountactionbean;
	private static SetAccountActionCall accountactioncall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("设置资金账户状态");
	}

	@Before
	public void caseUp() {
		accountactionbean = new SetAccountActionBean();
		accountactioncall = new SetAccountActionCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(accountactioncall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_SetAccountAction_001() {
		Logger.start(true,"设置账户状态正常");
		try {
			Map<?, ?> map = XloboAccountCallService.getAccountId();
			String AccountId = (String) map.get("AccountId");
			Logger.comment("账户Id:" + AccountId);
			accountactionbean.setAccountId(AccountId);
			// 账户状态
			Integer Action = 0;
			Logger.comment("账户状态为:" + Action);
			accountactionbean.setAction(Action);
			// 发送
			accountactioncall.setData(accountactionbean);
			accountactioncall.callService();
			// 校验
			Logger.debug(accountactioncall.getEntityString());
			Logger.debug(accountactioncall.getReturnData());
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_SetAccountAction_002() {
		Logger.start(true,"不输入账户ID");
		try {
			// TODO 补全case代码
			org.junit.Assert.fail();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_SetAccountAction_003() {
		Logger.start(true,"不输入账户状态");
		try {
			// TODO 补全case代码
			org.junit.Assert.fail();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_SetAccountAction_004() {
		Logger.start(true,"输入错误的账户状态");
		try {
			// TODO 补全case代码
			org.junit.Assert.fail();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}